package com.anjubao.parking.municipal.roadside.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author zhangyunbo
 * @date 2019/6/26 14:24
 */
@Getter
@AllArgsConstructor
public enum RecordTypeEnum {
    Recharge(1, "充值"),
    Low(2, "低杆停车缴费"),
   Middle(3, "中杆停车缴费");

    private Integer code;

    private String desc;

    public static String getDescByCode(Integer code) {
        for (RecordTypeEnum e : RecordTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getDesc();
            }
        }
        return null;
    }

    public static Boolean exist(Integer code) {
        for (RecordTypeEnum e : RecordTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}